<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Thông tin shop</title>
		<link rel="stylesheet" href="../css/reset.css" type="text/css" />
		<link rel="stylesheet" href="../css/common.css" type="text/css" />
		<link rel="stylesheet" href="../css/seller.css" type="text/css" />
		<script src="../scripts/jquery-1.5.2.min.js"></script>
		<script src="../scripts/common.js"></script>
		<script type="text/javascript">
        	$(document).ready(function(){
        		$("#btDangSuKien").bind("click", function()
				{
					if($("#tbTenSuKien").attr("value") != "" && $("#tbNgayBatDau").attr("value") != "" && $("#tbNgayKetThuc").attr("value") != "")
					{
						return true;
					}
					alert("Vui lòng nhập đầy các thông tin yêu cầu");
					return false;
				});
			})
        
        </script>
	</head>
	<body>
		<div id="page">
			<?php
				require("../DAO/DataHelper.php");
				require("../webconfig.php");
				require("../DAO/SuKien_DAO.php");
				require("../UserControl/header.php");
				if(isset($_REQUEST["DangSuKien"]))
				{
					session_start();
					$_SESSION["MaGH"] = 1;
					if(isset($_SESSION["MaGH"]))
					{
						$SuKien = new SuKien;
						$SuKien->sk_ten = $_REQUEST["TenSuKien"];
						$SuKien->sk_ngay_bat_dau = $_REQUEST["NgayBatDau"];
						$SuKien->sk_ngay_ket_thuc = $_REQUEST["NgayKetThuc"];
						$SuKien->sk_mo_ta = $_REQUEST["MoTa"];
						$SuKien->sk_ma_gian_hang = $_SESSION["MaGH"];
						$ID = SuKien::DangSuKien($SuKien);
						$url = GetUrl("NguoiBan/ChiTietSuKien.php?MaSK=$ID");
						$message = 'Đã đăng sự kiện thành công!';
						echo "<script>javascript:alert('".$message."'); window.location = '".$url."'</script>";
					}
				}
			?>

			<div id="content">
				<div id="shop-banner">
					<img src="../temp/shop-banner.jpg" />
				</div>
				<?php
					require("../UserControl_NguoiBan/MenuDanhMucChucNang.php");
				?>
				<div id="seller-shop-info" class="block layout-2col-col2">
					<div class="title">
					  <h3>Đăng Sự Kiện</h3>
				  </div>
					<div class="content">
                    <form method="post">
                        <table class="them-san-pham-table">                            
                            <tr>
								<td class="label-col"><label>Tên sự kiện:</label></td>
								<td><input name="TenSuKien" id="tbTenSuKien" type="text" /><label class='error' style="display:inline">*</label></td>
                            </tr>
                            
                            </tr>
                            <tr>
								<td class="label-col"><label>Ngày bắt đầu</label></td>
								<td><input name="NgayBatDau" type="date" id="tbNgayBatDau" /><label class='error' style="display:inline">*</label></td>
                            </tr>
                            <tr>
								<td class="label-col"><label>Ngày kết thúc</label></td>
								<td><input name="NgayKetThuc" type="date" id="tbNgayKetThuc" /><label class='error' style="display:inline">*</label></td>
                            </tr>
                            
                            <tr>
								<td class="label-col"><label>Mô tả sự kiện : </label></td>
								<td><textarea name="MoTa" style="height:70px"   id="tbMota" ></textarea></td>
                            </tr>								
								<td>
									<div><input type="submit" value="Thêm mới" id="btDangSuKien" name="DangSuKien" /></div><div><input type="reset" value="Làm lại" /></a></div>								  
								</td>
                            </tr>
                        </table>
					</form>
					</div>
				</div>
			</div>
			<?php
				require("../UserControl/footer.php");
			?>
		</div>
	</body>
</html>